{php}
// на сколько страниц нужно разбить вывод
$perpage = $this->get_template_vars('perpage');
$this->assign('pages', $perpage > 0 ? ceil($this->get_template_vars('total') / $perpage) : 0);
{/php}
<table cellspacing="1" cellpadding="7" width="100%" align="center" class="pages">
<tr>
	{if $pages > 1}
	<td>{if $pages > 1}Page {$page} of {$pages}{else}&nbsp;{/if}</td>
	<td align="right">
	{if $perpage lt $total}
	{if $page != 1}<a href="{url page=`$page-1`}">&larr; previous</a>{else}<span>&larr; previous</span>{/if}
	{section name="pagination" loop=$pages}
	{assign var=s value=$smarty.section.pagination}
	{if $s.iteration != $page}<a href="{url page=$s.iteration}">{$s.iteration}</a>{else}<span class="active">{$s.iteration}</span>{/if}
	{/section}
	{if $page != $pages}<a href="{url page=`$page+1`}">next &rarr;</a>{else}<span>next &rarr;</span>{/if}
	{/if}
	</td>
	{else}
	<td>&nbsp;</td>
	{/if}
</tr>
</table>
